<html>
<head><meta charset="utf-8"><title>reconsider stabilizing attribute? · project-ffi-unwind · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/index.html">project-ffi-unwind</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html">reconsider stabilizing attribute?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="179555594"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179555594" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179555594">(Oct 31 2019 at 17:34)</a>:</h4>
<p>I just learned about this: <a href="https://github.com/rust-lang/rust/pull/64010/" target="_blank" title="https://github.com/rust-lang/rust/pull/64010/">https://github.com/rust-lang/rust/pull/64010/</a></p>
<p>Would this resolve our previous concern about stabilizing the <code>unwind(abort)</code> attribute, namely, that it couldn't be used on function pointers? (As long as we add <code>unwind</code> to the list of attributes that can be used in parameter position, of course.)</p>
<p>As far as I can see, attributes are still not useable on local variables.</p>



<a name="179555875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179555875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179555875">(Oct 31 2019 at 17:37)</a>:</h4>
<p>IIRC the concern is that as implemented the attribute is not part of a function's type.</p>



<a name="179555887"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179555887" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179555887">(Oct 31 2019 at 17:37)</a>:</h4>
<p>We can revisit that debate but</p>



<a name="179555893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179555893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179555893">(Oct 31 2019 at 17:37)</a>:</h4>
<p>I think that the ABI version is kind of "just better" in most ways</p>



<a name="179556161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179556161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179556161">(Oct 31 2019 at 17:39)</a>:</h4>
<p>I think there is consensus that it should be part of the type, whether the syntax is an ABI string or an attribute is more a syntactic issue. There are certainly other cases where attributes as part of the type make sense (e.g. <code>#[target_feature]</code> is part of the function ABI, and we currently forbid creating pointers to target feature functions to work around that).</p>



<a name="179559382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179559382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179559382">(Oct 31 2019 at 18:08)</a>:</h4>
<p><span class="user-mention" data-user-id="120076">@Kyle Strand</span>  those attributes only work on formal params; not <em>types</em>. You'd need <a href="https://github.com/rust-lang/rfcs/pull/2602" target="_blank" title="https://github.com/rust-lang/rfcs/pull/2602">https://github.com/rust-lang/rfcs/pull/2602</a> for attributes on types.</p>



<a name="179559427"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179559427" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179559427">(Oct 31 2019 at 18:09)</a>:</h4>
<p>Also, I agree with <span class="user-mention" data-user-id="116009">@nikomatsakis</span> -- I'd also like to see the WG more focused and for it to have less back and forth</p>



<a name="179559710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179559710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179559710">(Oct 31 2019 at 18:11)</a>:</h4>
<p>I think that the merit in the "noexcept-like feature" is in the idea that we may not <em>want</em> the unwindability of a function to be in the type system, at least not without introducing a real <code>noexcept</code> feature that can be used independently of <code>extern</code>.</p>



<a name="179559861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179559861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179559861">(Oct 31 2019 at 18:12)</a>:</h4>
<blockquote>
<p>Also, I agree with <span class="user-mention silent" data-user-id="116009">nikomatsakis</span> -- I'd also like to see the WG more focused and for it to have less back and forth</p>
</blockquote>
<p>I'm not sure how to help with that at this point. It seems to me that we do have some genuinely new information being introduced (e.g. from discussion w/ Amanieu).</p>



<a name="179559931"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179559931" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179559931">(Oct 31 2019 at 18:13)</a>:</h4>
<p><span aria-label="frown" class="emoji emoji-1f641" role="img" title="frown">:frown:</span> -- I was hoping to get the soundness hole closed in a reasonable timeframe</p>



<a name="179560143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179560143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179560143">(Oct 31 2019 at 18:15)</a>:</h4>
<p>So was I. But I am of the opinion that letting <code>extern "C"</code> unwind is a perfectly reasonable way to do that.</p>



<a name="179560227"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179560227" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179560227">(Oct 31 2019 at 18:16)</a>:</h4>
<p>I've also said that I personally don't have an objection to stabilizing the abort-on-unwind shim.</p>



<a name="179560257"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179560257" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> centril <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179560257">(Oct 31 2019 at 18:16)</a>:</h4>
<p><span class="user-mention" data-user-id="120076">@Kyle Strand</span> appreciated</p>



<a name="179562260"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179562260" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BatmanAoD (Kyle Strand) <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179562260">(Oct 31 2019 at 18:33)</a>:</h4>
<p><span class="user-mention" data-user-id="132920">@gnzlbg</span> See the PR link up above; such attributes can at least be applied to fn pointers in function params, which may be sufficient for now</p>



<a name="179562347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179562347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179562347">(Oct 31 2019 at 18:34)</a>:</h4>
<p>It isn't sufficient for statics I think.</p>



<a name="179562395"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179562395" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179562395">(Oct 31 2019 at 18:34)</a>:</h4>
<p>e.g. <code>static X: Option&lt;#[unwind(aborts)] fn()&gt; = ...;</code> would need to work</p>



<a name="179562421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/210922-project-ffi-unwind/topic/reconsider%20stabilizing%20attribute%3F/near/179562421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/210922-project-ffi-unwind/topic/reconsider.20stabilizing.20attribute.3F.html#179562421">(Oct 31 2019 at 18:34)</a>:</h4>
<p>but I don't see any reasons why we can't make that work</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>